package cn.com.surker.sale.entity;

import cn.com.surker.enums.StateEnum;
import cn.hutool.db.DaoTemplate;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 销售日报表统计量差记录
 * </p>
 *
 * @author admin
 * @since 2024-06-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SaleDiffPrice implements Serializable {

	private static final long serialVersionUID = 1L;

	public SaleDiffPrice() {

	}

	public SaleDiffPrice(Long orgId, Long conId, Double stere, Integer diffType, String month, BigDecimal diffPrice, BigDecimal diffTotal, Date createTime, Long creater, String remarks) {
		this.orgId = orgId;
		this.conId = conId;
		this.stere = stere;
		this.diffType = diffType;
		this.month = month;
		this.diffPrice = diffPrice;
		this.diffTotal = diffTotal;
		this.createTime = createTime;
		this.creater = creater;
		this.remarks = remarks;
		this.status = StateEnum.ENABLED.getCode();
	}

	/**
	 * 调差类型-砼价格
	 */
	public static final int DIFF_TYPE_LEVEL = 0;

	/**
	 * 调差类型-泵送价格
	 */
	public static final int DIFF_TYPE_PUMP = 1;

	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 操作人员
	 */
	private Long userId;

	/**
	 * 操作人员名
	 */
	private String userName;

	/**
	 * 统计起始日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
	private Date startTime;

	/**
	 * 统计截止日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
	private Date endTime;

	/**
	 * 调差月份,格式为yyyy-MM
	 */
	private String month;

	/**
	 * 站点id
	 */
	private Long orgId;

	/**
	 * 站点名称
	 */
	private String orgName;

	/**
	 * 工地id
	 */
	private Long conId;

	/**
	 * 工地名称
	 */
	@TableField(exist = false)
	private String conName;

	/**
	 * 客户名称
	 */
	@TableField(exist = false)
	private String clientName;

	/**
	 * 销售人员
	 */
	private String salesman;

	/**
	 * 影响方量
	 */
	private Double stere;

	/**
	 * 调差类型
	 */
	private Integer diffType;

	/**
	 * 变动数据id,如果是泵送方式这种由多个组成的,则用"_"分开
	 */
	private Long dataId;

	/**
	 * 标号名称
	 */
	private String dataName;

	/**
	 * 单方量差
	 */
	private BigDecimal diffPrice;

	/**
	 * 原本的单价
	 */
	private BigDecimal oldPrice;

	/**
	 * 新单价
	 */
	private BigDecimal newPrice;

	/**
	 * 旧总价
	 */
	private BigDecimal oldTotal;

	/**
	 * 新总价
	 */
	private BigDecimal newTotal;

	/**
	 * 调差总价
	 */
	private BigDecimal diffTotal;

	/**
	 * 状态
	 */
	private Integer status;

	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT, update = "now()")
	@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
	private Date createTime;

	/**
	 * 创建人员
	 */
	private Long creater;

	/**
	 * 修改时间
	 */
	@TableField(fill = FieldFill.UPDATE, update = "now()")
	@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
	private Date updateTime;

	/**
	 * 修改人员
	 */
	private Long updater;

	/**
	 * 备注
	 */
	private String remarks;


}
